package com.zmovie.framework.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zmovie.framework.domain.MovieRuntime;
import com.zmovie.framework.service.MovieRuntimeService;
import com.zmovie.framework.mapper.MovieRuntimeMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author lenovo
* @description 针对表【movie_runtime】的数据库操作Service实现
* @createDate 2023-11-30 12:27:33
*/
@Service
public class MovieRuntimeServiceImpl extends ServiceImpl<MovieRuntimeMapper, MovieRuntime>
    implements MovieRuntimeService{

    @Override
    public List<MovieRuntime> listMovieRuntimes(MovieRuntime movieRuntime) {
        LambdaQueryWrapper<MovieRuntime> wrapper = new LambdaQueryWrapper<>();
        wrapper.like(movieRuntime.getName() != null, MovieRuntime::getName, movieRuntime.getName());
        wrapper.orderByAsc(MovieRuntime::getId);
        return list(wrapper);
    }
}




